<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .box {
            width: 150px;
            height: 150px;
            border: 1px solid black;
            margin: 20px;
        }
    </style>
</head>
<body>
    <div id="app">
        <h3>组件</h3>
        <com v-for="item in 12" />
    </div>

    <script src="https://cdn.jsdelivr.net/npm/vue@2.6.14/dist/vue.js"></script>
    <script>
        // 全局组件
        // Vue.component('组件名称', 结构)
        const Com = {
            template: `
              <div class="box">
                12
              </div>
              `
        }
        Vue.component('com', Com)
        const app = new Vue({
            el: "#app",
            data: {}
        })
    </script>
</body>
</html>